/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ControllerLayer.ControlServices.Preprocessor;

import com.mathworks.toolbox.javabuilder.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import preprocessor.*;

/**
 *
 * @author Kovács Áron
 */
public class ExternalPreprocessor {

    private String path;
    Preprocessor prep;

    ExternalPreprocessor(String originalImagePath) {
        System.out.println("1");
        path = originalImagePath;
        try {
            prep = new Preprocessor();
        } catch (MWException ex) {
            System.out.println(ex);
        }
    }

    /**
     * Preprcesses the image
     */
    public void preprocessImage() {
        try {
            path = "E:\\Manuscript.png";
            System.out.println("1");
            
            System.out.println("2");
            prep.preprocessImage(path);
            System.out.println("3");
        } catch (MWException ex) {
            System.out.println(ex);
        } finally {
            if (prep != null) {
                prep.dispose();
            }
        }
        System.out.println("4");
    }

    public static void main(String[] args) {
        ExternalPreprocessor extPr = new ExternalPreprocessor("dummy");
        extPr.preprocessImage();
        System.out.println("5");
        System.exit(0);
    }
}
